<?php
	if(isset($defaultTopicList))
	{
		echo("<table>");
		foreach ($defaultTopicList as $i => $value) 
		{
			echo("<tr class='topic-row'>");
			
			echo("<td class='topic-name-col'>");
			echo ('<a href="community.php?topic='.$value["topic_id"].'">'.$value["name"] .'</a>');
			echo("</td>");
			
			echo("<td class='topic-post-count-col'>");
			$topic_count = 0;
			if(isset($value["post_count"]))
			{
				$topic_count = $value["post_count"];
			}
			echo ('<a href="community.php?topic='.$value["topic_id"].'">'.'<span class="badge">'. $topic_count .' Posts</span>');
			echo("</td>");			
			
			echo("<td class='topic-control-col'>");
			$topicID = $value["topic_id"];
			include('./templates/TopicControls.php');			
			echo("</td>");
			
			echo("</tr>");
		}
		echo("</table>");
	}
?>